<?php
//PLUGIN type=action
//PLUGIN name=module.remove
//PLUGIN desc=Enables you to remove modules from your pages
//PLUGIN group=native


    for ($i = count($c_xml->content->module)-1 ; $i >= 0 ; $i--) {
        if((string)$c_xml->content->module[$i]->id==$options['module']) {
            unset($c_xml->content->module[$i]);
            $d = $c_path."!content/".$options['module'];
            unlinkRecursive($d, true);
            file_put_contents($c_xml_file, $c_xml->asXML());
        }
    }
    header("Location:.?q=command:cms;view:cms.editor;page:".$c_site['meta']['page']);


?>